package com.kmproject.haifu.mvp.ui.bis.recharge;

import android.app.Application;

import com.google.gson.Gson;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.kmproject.haifu.mvp.model.api.service.MemberCenterService;
import com.kmproject.haifu.mvp.model.entity.ResultBean;
import com.kmproject.haifu.mvp.model.entity.beans.ExchangeRateBean;
import com.kmproject.haifu.mvp.model.entity.beans.HousePayWayBean;
import com.kmproject.haifu.mvp.model.entity.beans.MemberPayResultBean;

import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 * 充值缴费支付相关
 */
public class RechargeBaseModel extends BaseModel implements IModelRecharge {
    @Inject
    Gson mGson;
    @Inject
    Application mApplication;

    public RechargeBaseModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public Observable<ResultBean<List<HousePayWayBean>>> getPayWay(String value) {
        return mRepositoryManager.obtainRetrofitService(MemberCenterService.class).dictList(value, "");
    }

    @Override
    public Observable<ResultBean<ExchangeRateBean>> getExchangeRate(String totalAmount) {
        return mRepositoryManager.obtainRetrofitService(MemberCenterService.class).getExchangeRate_2(totalAmount);
    }

    @Override
    public Observable<ResultBean<String>> rechargeCallCharge4AliPay(Map<String, Object> maps) {
        return mRepositoryManager.obtainRetrofitService(MemberCenterService.class).payInvestMoney4AliPay(creatRequestBody(maps, mGson));
    }

    @Override
    public Observable<ResultBean<MemberPayResultBean>> rechargeCallCharge4Wx(Map<String, Object> maps) {
        return mRepositoryManager.obtainRetrofitService(MemberCenterService.class).payInvestMoney4Wx(creatRequestBody(maps, mGson));
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}
